home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / raytrace / rayshade / graphtal.lzh / Graphtal.Amiga / ViewTransform.h < prev    next >
C/C++ Source or Header  |  1992-11-17  |  2KB  |  61 lines

  1. /*
  2.  * ViewTransform.h - class definition general view transformation.
  3.  *
  4.  * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
  5.  *                     University of Berne, Switzerland
  6.  * All rights reserved.
  7.  *
  8.  * This software may be freely copied, modified, and redistributed
  9.  * provided that this copyright notice is preserved on all copies.
  10.  *
  11.  * You may not distribute this software, in whole or in part, as part of
  12.  * any commercial product without the express consent of the authors.
  13.  *
  14.  * There is no warranty or other guarantee of fitness of this software
  15.  * for any purpose.  It is provided solely "as is".
  16.  *
  17.  */
  18.  
  19. #ifndef ViewTransform_H
  20. # define ViewTransform_H
  21.  
  22. #include <iostream.h>
  23. #include "Vector.h"
  24. #include "TransMatrix.h"
  25. #include "BoundingBox.h"
  26.  
  27. //___________________________________________________________ ViewTransform
  28.  
  29. class ViewTransform
  30. {
  31. public:
  32.   ViewTransform(const Vector&, const Vector&, const Vector&, real, int, int);
  33.   ViewTransform(const BoundingBox&, const Vector&, real, int, int);
  34.  
  35.   Vector transformWorld2Screen(const Vector&);
  36.   Vector transformWorld2View(const Vector&);
  37.   Vector transformView2Screen(const Vector&);
  38.  
  39.   const Vector& getEye()    const { return eye; }
  40.   const Vector& getLookat() const { return lookat; }
  41.   const Vector& getUp()     const { return up; }
  42.   real getFov()             const { return fov; }
  43.   int getResX()             const { return resX; }
  44.   int getResY()             const { return resY; }
  45.   const TransMatrix& getViewmat() const { return viewmat; }
  46.  
  47.   friend ostream& operator<<(ostream&, const ViewTransform&);
  48.  
  49. private:
  50.   void buildView();
  51.  
  52.   TransMatrix viewmat;
  53.   Vector eye, lookat, up;
  54.   real fov;
  55.   int resX, resY;
  56.   real widthOfViewplane;
  57. };
  58.  
  59.  
  60. #endif // ViewTransform_H
  61.